-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make actions use target=this
implicitly
#14479
Conversation
I added a test. |
<button {{action this 'foo'}}> | ||
<button onblur={{action this 'foo'}}> | ||
<button onblur={{action this (action this 'foo') 'bar'}}> | ||
<button {{action target=this 'foo'}}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't quite right, the hash has to be after positional args...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL...
<button onblur={{action this (action this 'foo') 'bar'}}> | ||
<button {{action target=this 'foo'}}> | ||
<button onblur={{action target=this 'foo'}}> | ||
<button onblur={{action target=this (action target=this 'foo') 'bar'}}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this also backwards.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes; it has been corrected.
} | ||
|
||
return false; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is unfortunately repeated. @rwjblue should the util function be DRY somewhere? And if so where?
if (pair.key === key) { | ||
return pair; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is unfortunately repeated. @rwjblue should the util function be DRY somewhere? And if so where?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will extract it and then make another PR to update other refs.
45ec17b
to
ffbc7bf
Compare
@zackthehuman is this ready for a new review? Thank you! |
@zackthehuman thank you! |
This addresses the bug in #14469. Might need a new test. Please review @rwjblue @chancancode.